<extend name="Layout/ins_page" />
<block name="content">
	<div id="cal" class="day">
		<div id="top" class="operate panel panel-default">
			<div class="panel-body">
				<div class="pull-left">
					<a id="panel" class="btn btn-sm btn-primary"> </a>
					<a onclick="pushBtm('MU');" class="btn btn-sm btn-primary"><i class="fa fa-chevron-left"></i></a>
					<a onclick="pushBtm('MD');" class="btn btn-sm btn-primary"><i class="fa fa-chevron-right"></i></a>
					<a onclick="pushBtm('');" class="btn btn-sm btn-primary"> 今天 </a>
					<input type="text" name="start_date" id="start_date" style="display:none">
					<input type="text" name="end_date" id="end_date" style="display:none">
				</div>
				<div class="pull-right">
					<a onclick="month_view();" class="btn btn-sm btn-primary"> 月视图 </a>
					<a onclick="add();" class="btn btn-sm btn-primary"> 新建 </a>
				</div>
			</div>
		</div>
		<form method="post" action="" name="CLD">
			<div style="display:none">
				<font> 公历
					<select id="year" onchange="changeCld()" name="SY">
						<script language=JavaScript>
							for ( i = 1900; i < 2050; i++)
								document.write('<option>' + i)
						</script>
					</select> 年
					<select id="month" onchange="changeCld()" name="SM">
						<script language=JavaScript>
							for ( i = 1; i < 13; i++)
								document.write('<option>' + i)
						</script>
					</select> 月 </font>
				<font id="GZ"> </font>
			</div>
			<div class="row">
				<div class="col-sm-4" style="height:260px;">
					<div class="mv-container" style="height:250px;min-height:250px;">
						<table class="mv-daynames-table" cellspacing="0" cellpadding="0">
							<tbody>
								<tr>
									<th title="周日" class="mv-dayname"> 周日 </th>
									<th title="周一" class="mv-dayname"> 周一 </th>
									<th title="周二" class="mv-dayname"> 周二 </th>
									<th title="周三" class="mv-dayname"> 周三 </th>
									<th title="周四" class="mv-dayname"> 周四 </th>
									<th title="周五" class="mv-dayname"> 周五 </th>
									<th title="周六" class="mv-dayname"> 周六 </th>
								</tr>
							</tbody>
						</table>
						<div class="mv-event-container" id="mvEventContainer" style="height:225px;">
							<div class="month-row" style="top:0%; height:36px;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle"><span class="left" id="SD0"> </span><span class="right" id="LD0"> </span></td>
											<td class="st-dtitle  "><span class="left" id="SD1"> </span><span class="right" id="LD1"> </span></td>
											<td class="st-dtitle  "><span class="left" id="SD2"> </span><span class="right" id="LD2"> </span></td>
											<td class="st-dtitle  "><span class="left" id="SD3"> </span><span class="right" id="LD3"> </span></td>
											<td class="st-dtitle "><span class="left" id="SD4"> </span><span class="right" id="LD4"> </span></td>
											<td class="st-dtitle "><span class="left" id="SD5"> </span><span class="right" id="LD5"> </span></td>
											<td class="st-dtitle "><span class="left" id="SD6"> </span><span class="right" id="LD6"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL0"></ul></td>
											<td class="st-c "><ul id="UL1"></ul></td>
											<td class="st-c "><ul id="UL2"></ul></td>
											<td class="st-c "><ul id="UL3"></ul></td>
											<td class="st-c "><ul id="UL4"></ul></td>
											<td class="st-c "><ul id="UL5"></ul></td>
											<td class="st-c "><ul id="UL6"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="month-row" style="top:37px;height:36px;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle "><span class="left" id="SD7"> </span><span class="right" id="LD7"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD8"> </span><span class="right" id="LD8"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD9"> </span><span class="right" id="LD9"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD10"> </span><span class="right" id="LD10"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD11"> </span><span class="right" id="LD11"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD12"> </span><span class="right" id="LD12"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD13"> </span><span class="right" id="LD13"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL7"></ul></td>
											<td class="st-c "><ul id="UL8"></ul></td>
											<td class="st-c "><ul id="UL9"></ul></td>
											<td class="st-c "><ul id="UL10"></ul></td>
											<td class="st-c "><ul id="UL11"></ul></td>
											<td class="st-c "><ul id="UL12"></ul></td>
											<td class="st-c "><ul id="UL13"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="month-row" style="top:74px; height:36px;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle "><span class="left" id="SD14"> </span><span class="right" id="LD14"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD15"> </span><span class="right" id="LD15"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD16"> </span><span class="right" id="LD16"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD17"> </span><span class="right" id="LD17"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD18"> </span><span class="right" id="LD18"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD19"> </span><span class="right" id="LD19"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD20"> </span><span class="right" id="LD20"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL14"></ul></td>
											<td class="st-c "><ul id="UL15"></ul></td>
											<td class="st-c "><ul id="UL16"></ul></td>
											<td class="st-c "><ul id="UL17"></ul></td>
											<td class="st-c "><ul id="UL18"></ul></td>
											<td class="st-c "><ul id="UL19"></ul></td>
											<td class="st-c "><ul id="UL20"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="month-row" style="top:111px; height:36px;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle "><span class="left" id="SD21"> </span><span class="right" id="LD21"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD22"> </span><span class="right" id="LD22"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD23"> </span><span class="right" id="LD23"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD24"> </span><span class="right" id="LD24"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD25"> </span><span class="right" id="LD25"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD26"> </span><span class="right" id="LD26"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD27"> </span><span class="right" id="LD27"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL21"></ul></td>
											<td class="st-c "><ul id="UL22"></ul></td>
											<td class="st-c "><ul id="UL23"></ul></td>
											<td class="st-c "><ul id="UL24"></ul></td>
											<td class="st-c "><ul id="UL25"></ul></td>
											<td class="st-c "><ul id="UL26"></ul></td>
											<td class="st-c "><ul id="UL27"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="month-row" style="top:148px;height:36px;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle "><span class="left" id="SD28"> </span><span class="right" id="LD28"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD29"> </span><span class="right" id="LD29"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD30"> </span><span class="right" id="LD30"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD31"> </span><span class="right" id="LD31"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD32"> </span><span class="right" id="LD32"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD33"> </span><span class="right" id="LD33"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD34"> </span><span class="right" id="LD34"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL28"></ul></td>
											<td class="st-c "><ul id="UL29"></ul></td>
											<td class="st-c "><ul id="UL30"></ul></td>
											<td class="st-c "><ul id="UL31"></ul></td>
											<td class="st-c "><ul id="UL32"></ul></td>
											<td class="st-c "><ul id="UL33"></ul></td>
											<td class="st-c "><ul id="UL34"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
							<div class="month-row" style="top:185px;bottom:0;">
								<table class="st-bg-table" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-bg "> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
											<td class="st-bg"> &nbsp; </td>
										</tr>
									</tbody>
								</table>
								<table class="st-grid" cellspacing="0" cellpadding="0">
									<tbody>
										<tr>
											<td class="st-dtitle "><span class="left" id="SD35"></span><span class="right" id="LD35"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD36"> </span><span class="right" id="LD36"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD37"> </span><span class="right" id="LD37"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD38"> </span><span class="right" id="LD38"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD39"> </span><span class="right" id="LD39"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD40"> </span><span class="right" id="LD40"> </span></td>
											<td class="st-dtitle"><span class="left" id="SD41"> </span><span class="right" id="LD41"> </span></td>
										</tr>
										<tr>
											<td class="st-c "><ul id="UL35"></ul></td>
											<td class="st-c "><ul id="UL36"></ul></td>
											<td class="st-c "><ul id="UL37"></ul></td>
											<td class="st-c "><ul id="UL38"></ul></td>
											<td class="st-c "><ul id="UL39"></ul></td>
											<td class="st-c "><ul id="UL40"></ul></td>
											<td class="st-c "><ul id="UL41"></ul></td>
										</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<div class="col-sm-8">
					<ul class="event_list clearfix"></ul>
				</div>
			</div>
		</form><div id="dialog2"></div>
	</div>
</block>
<block name="js">
	<script type="text/javascript" src="__INS__/js/plugins/calendar/calendar.js"></script>
	<script type="text/javascript">
		function showdata() {
			$("ul.event_list").html("");
			y = $("#year").val();
			m = $("#month").val();
			$("#panel").html(y + "年" + m + "月");
			start_date1 = $("#UL0").attr("class").substr(4);
			end_date1 = $("#UL41").attr("class").substr(4);
			$.getJSON("{:U('json')}", {
				start_date : start_date1,
				end_date : end_date1
			}, function(data) {
				count = 0;
				prev_date = '';
				if (data != null) {
					$.each(data, function(i) {
						html = '<li id=li_' + data[i].id + ' style=background-color:' + schedule_bg(data[i].priority) + ">";
						html += '<i class="ico_square"></i>';
						html += '<span class="event_time">' + data[i].start_time.substr(0, 10) + '</span>';
						html += ' <p id=' + data[i].id + ' class="event_msg" title="' + data[i].name + '">';
						html += data[i].name;
						html += ' </p>';
						html += "</li>";
						prev_date = data[i].start_time;
						$("ul.event_list").append(html);
					});
				}
			});
		}

		function add() {
			window.open("{:U('add')}", "_self");
		}

		function month_view() {
			window.open("{:U('index')}", "_self");
		}

		function day_view() {
			window.open("{:U('day_view')}", "_self");
		}


		$(document).ready(function() {
			set_return_url();
			initial();
			$("#cm div").click(function() {
				$("#cm div.active").removeClass("active");
				$(this).addClass("active");
			});

			$(document).on("click", "p.event_msg", function() {
				var msg_list = "";
				current = $(this).attr('id');
				$("p#" + current).parent().parent().find('p.event_msg').each(function() {
					msg_list += $(this).attr("id") + "|";
				});
				winopen("{:U('read')}?id=" + $(this).attr('id') + "&list=" + msg_list, 560, 470);
			});
		});
		//-->
	</script>
</block>